﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace brjostagjof.Models
{
    public interface IDataRepository
    {
        IEnumerable<ArticleBase> FrontPageLatestTen();
        IEnumerable<New> NewsLatestFive();
        IEnumerable<Article> ArticlesLatestFive();
        IEnumerable<Question> QuestionsLatestFive();

        IEnumerable<New> NewsLatestTen();
        IEnumerable<Article> ArticlesLatestTen();
        IEnumerable<Question> QuestionsLatestTen();

        void AddNews(NewsContainer news);
        void UpdateNews(New news);
        void DeleteNews(New news);
        IEnumerable<New> GetHiddenNews();
        New GetNewsByID(int ID);
        IEnumerable<New> GetNewsByCategory(ArticleCategory category);
        List<SelectListItem> GetNewsList();
        IEnumerable<New> GetAllNews();
        IEnumerable<New> GetNewsByCategoryID(int ID);
        IEnumerable<ArticleCategory> GetNewsCategories();
        IEnumerable<New> GetNewsByCategoryIDHeadlineAlphabetical(int ID);
        IEnumerable<New> Get10NewsByPageID(int ID);

        void AddArticle(ArticleContainer article);
        List<SelectListItem> GetArticleList();
        void UpdateArticle(Article article);
        void AddArticleCategory(ArticleCategory artcat);
        void DeleteArticle(Article article);
        Article GetArticleByID(int ID);
        IEnumerable<Article> GetArticleByCategory(ArticleCategory category);
        IEnumerable<Article> GetAllArticles();
        IEnumerable<ArticleCategory> GetArticleCategories();
        ArticleCategory GetArticleCategoryByID(int ID);
        ArticleCategory GetArticleCategoryName(string ourName);
        IEnumerable<Article> GetArticleByCategoryID(int ID);
        IEnumerable<Article> GetArticlesByCategoryIDHeadlineAlphabetical(int ID);
        IEnumerable<Article> Get10ArticleByPageID(int ID);
        IEnumerable<Article> GetHiddenArticles();

        void AddQuestion(QuestionContainer question);
        void UpdateQuestion(Question question);
        void UpdateAnswer(Question question);
        void DeleteQuestion(Question question);
        Question GetQuestionByID(int ID);
        IEnumerable<Question> GetQuestionByCategory(ArticleCategory category);
        IEnumerable<Question> GetUnansweredQuestions();
        List<SelectListItem> GetQuestionList();
        IEnumerable<Question> GetQuestionByCategoryID(int ID);
        IEnumerable<Question> GetQuestionByCategoryIDHeadlineAlphabetical(int ID);
        IEnumerable<Question> GetAllQuestions();
        IEnumerable<ArticleCategory> GetQuestionCategories();
        IEnumerable<Question> Get10QuestionsByPageID(int ID);

        void AddPracticalInformation(PracticalInformation pi, InformationBase inf);
        void AddPracticalInformationCategory(InformationCategory picat);
        void CreatePracticalInformation(PracticalInformation pi);
        void UpdatePracticalInformation(PracticalInformation pi);
        PracticalInformation GetPracticalInformationByID(int ID);
        InformationCategory GetInformationCategoryByID(int ID);
        IEnumerable<InformationCategory> GetAllInformationCategories();
        IEnumerable<PracticalInformation> GetPracticalInformationByCategory(InformationCategory category);

        void UpdateAboutUs(PracticalInformation pi);
        PracticalInformation GetAboutUs();

        InformationBase GetInformationByID(int ID);

        void CreateSurvey(SurveyContainer survey);
        void UpdateSurvey(SurveyContainer survey);
        IEnumerable<Choice> UpdateChoices(int ID, User user);
        void DeleteSurvey(SurveyContainer survey);
        SurveyContainer GetSurveyByID(int ID);
        SurveyContainer GetCurrentSurvey();
        IEnumerable<SurveyContainer> GetAllSurveys();
        IEnumerable<Choice> GetChoicesBySurveyID(int surveyID);
        bool HasUserVoted(int userID);

        void CreateChild(Children child);
        void CreateChildWithPhoto(Picture pic, Children child);
        void UpdateChild(Children child);
        void DeleteChild(Children child);
        Children GetChildByID(int ID);
        IEnumerable<Children> GetChildrenByUserID(int ID);
        void AddEntryToTimeline(TimeLineEntry entry);
        IEnumerable<TimeLineEntry> GetChildTimeline(int childID);
        IEnumerable<TimeLineEntry> GetTimeLineByID(int ID);

        MySiteContainer GetMySite(int ID);
        ArticleBaseCollection GetCollectionByUserAndID(int fakeUserID, int InformationID);
        void AddArticleBaseCollection(ArticleBaseCollection c);
        void DeleteArticleBaseCollection(ArticleBaseCollection c);
        Picture GetPicByID(int ID);
        Picture GetPicByPictureID(int ID);
        void UpdateMyProfile(User ourUser);
        Contact GetContacts(int ID1, int ID2);
        void SaveContact(Contact toSave);
        void DeleteContact(int id1, int id2);

        void AddSpecialistCategory(SpecialistCategory specat);
        IEnumerable<SpecialistUser> GetSpecialistsByCategoryID(int ID);
        IEnumerable<SpecialistCategory> GetSpecialistGategories();
        SpecialistUser GetSpecialistByID(int ID);
        IEnumerable<SpecialistUser> GetSpecialists();

        User GetUserByName(string name);
        User GetUserByID(int ID);
        void CreateUser(User user);
        void AddSpecialistUser(User user, SpecialistUser spUser);

        IEnumerable<Comment> GetCommentsByID(int ID);
        IEnumerable<Comment> GetCommentsByUserID(int ID);
        void AddComment(Comment comment);
        IEnumerable<Comment> GetCommentsByArticleBaseID(int ID);

        void SavePicToDB(Picture pic);
        Picture GetPictureByID(int ID);
        IEnumerable<Picture> GetPicturesByUserID(int ID);
    }
}
